package com.hudilao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hudilao.entity.Dish;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface DishMapper extends BaseMapper<Dish> {


    //查询当前id的菜品
    @Select("SELECT * FROM dish WHERE id = #{id}")
    Dish selectById(Long id);


    //更新菜品状态
    @Update("UPDATE dish SET status = #{status} WHERE id = #{id}")
    int updateStatusById(Dish dish);
}
